import db from '@/utils/localstorage';

export default {
  namespaced: true,
  state: {
    token: db.get("TOKEN", ''),
    tenant: db.get("TENANT", ''),
  },
  mutations: {
    setTenant(state, val) {
      db.save("TENANT", val);
      state.tenant = val;
    },
    setToken(state, val) {
      db.save("TOKEN", val);
      state.token = val;
    },
    removeToken(state) {
      db.remove("TOKEN");
    }
  }
}